#include <iostream>

using namespace std;

/**
 * https://www.luogu.com.cn/problem/P1047
 */
int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;

    if(n==0){
        int x;
        cin >> x;
		cout << x;
		return 0;
	}

    for(int i=n; i>=0; i--){
        int x;
        cin >> x;
        
        if (i == n){
            if(x>0){
                if (x == 1){
                    cout << "x^" << n;
                }else{
                    cout << x << "x^" << n;
                }
            }else if (x<0){
                if (x == -1){
                    cout << "-" << "x^" << n;
                }else{
                    cout  << x << "x^" << n;
                }
            }else{
                continue;
            }
        }else if(i == 0){
            if(x > 0){
                cout << "+" << x;
            }else if (x<0){
                cout << x;
            }else{
                continue;
            }
        }else if(i == 1) {
            if (x > 0) {
                if (x == 1) {
                    cout << "+" << "x";
                }
                else {
                    cout << "+" << x << "x";
                }
            }
            else if (x < 0) {
                if (x == -1) {
                    cout << "-" << "x";
                }
                else {
                    cout << x << "x";
                }
            }
            else {
                continue;
            }
        }else{
            if (x>0){
                if (x==1){
                    cout << "+" << "x^" << i;
                }else{
                    cout << "+" << x << "x^" << i;
                }
            }else if(x<0){
                if (x == -1){
                    cout << "-" << "x^" << i;
                }else{
                    cout << x << "x^" << i;
                }
            }else{
                continue;
            }
        }
    }
    return 0;
}